#ifndef ______WARD___LISTBOX_H
#define ______WARD___LISTBOX_H


#include "uielement.h"
#include "textBox.h"
#include "driver.h"

#define LISTBOX_UP 0
#define LISTBOX_DOWN 1
#define LISTBOX_SELECT 2

class listBox : public uielement
{

public:

	listBox(int x, int y, int maxVisible, int w, string source, bool updown);

	void select() {if(curr != -1) {} }
	void left() {}
	void right() {}
	float getData() { return curr; }
	void setData(float f) { data = f; }
	string getText(int pos) { return entries[pos]->getString(); }

	void draw() { drawEnabled(xpos,ypos); }
	void drawAt(int x, int y) { drawEnabled(x, y); }

	bool clicked(int x, int y); 

	void onClick();

private:

	vector <textBox*> entries;
	int top;
	int curr;
	int maxVis, width;
	bool scroll;
	int clicktype, clickY;

	void drawEnabled(int x, int y);
	void drawDisabled();
	vector<string> loadFrom(string src);

};




#endif